<!-- sua bai viet-->
<?php echo validation_errors(); ?>

<form method="POST" action="<?php echo base_url() . 'admin/xuly/quangcao/list/' . $this->uri->segment(5); ?>">
    <div class="box_heading">
        <div class="icon">
            <img src="<?php echo base_url() . 'template/admin/images/icon_settings.png'; ?>"/> Quảng cáo ( <span style="color: red;"> * : không được để trống</span> )  <?php
            if (!empty($thongbao)) {
                echo '<img src=' . base_url() . 'template/admin/images/ok.png class="ok"><font color=red><b>' . $thongbao . '</b></font>';
            }
            ?>
        </div>
        <div class="right">    
            <a href="<?php echo base_url() . 'admin/xuly/quangcao'; ?>">Hủy</a>
        </div>
    </div>

    <div class="box_noidung">
        <table class="form">
            <tr><td><font color=red>* </font>Tiêu đề</td><td><input type="text" size="40" value="<?php
            if (!empty($data)) {
                echo $data->title;
            };
            ?>" name="title"/></td></tr>
            
            <tr><td><font color=red>* </font>Alt</td><td><input type="text" size="40" value="<?php
                                                                        if (!empty($data)) {
                                                                            echo $data->alt;
                                                                        };
            ?>" name="alt"/></td></tr>
            <tr><td><font color=red>* </font>Trạng thái</td><td>
                    <select name="publish">                                            
                        <option <?php
                            if (!empty($data)) {
                                if ($data->publish == '1')
                                    echo 'selected="selected"';
                            }
            ?> value='1'>Hiện</option>';
                        <option <?php
                            if (!empty($data)) {
                                if ($data->publish == '0')
                                    echo 'selected="selected"';
                            }
            ?> value='0'>Ẩn</option>';                                              
                    </select> 
                </td></tr>
            <tr><td><font color=red>* </font>Vị trí</td><td>
                    <select name="position">                                            
                        <option <?php
                            if (!empty($data)) {
                                if ($data->position == '2')
                                    echo 'selected="selected"';
                            }
            ?> value='2'>Liên kết website</option>';      
                        <option <?php
                    if (!empty($data)) {
                        if ($data->position == '3')
                            echo 'selected="selected"';
                    }
                    ?> value='3'>Quảng cáo</option>';
                        <option <?php
                    if (!empty($data)) {
                        if ($data->position == '4')
                            echo 'selected="selected"';
                    }
                    ?> value='4'>Logo đối tác</option>';                                                                  
                    </select> 
                </td></tr>
            <tr><td><font color=red>* </font>Ảnh đại diện</td><td>

                    <input type="text" id="xFilePath" name="image"  size="53" class="medium" value="<?php
                        if (!empty($data)) {
                            echo $data->image;
                        }
                        ?>" />
                    <input type="button" value="Tải ảnh lên" onclick="BrowseServer();" style="background-color: #E5E3E3;background-image: url('../../resources/images/button.png');" />                               
                </td></tr>
            <tr><td>Liên kết</td><td><input type="text" size="40" value="<?php
                        if (!empty($data)) {
                            echo $data->url;
                        } else
                            echo 'idvietnam.com';
                        ?>" name="url"/></td></tr>
            <tr><td>Sắp xếp</td><td><input type="text" size="40" value="<?php
                        if (!empty($data)) {
                            echo $data->order;
                        } else
                            echo '0';
                        ?>" name="order"/></td></tr>
            <tr><td><font color=red>* </font>Thuộc tính Rel</td><td>
                    <select name="rel">                                            
                        <option <?php
                        if (!empty($data)) {
                            if ($data->rel == '1')
                                echo 'selected="selected"';
                        }
                        ?> value='1'>NoFllow</option>';
                        <option <?php
                        if (!empty($data)) {
                            if ($data->rel == '0')
                                echo 'selected="selected"';
                        }
                        ?> value='0'>DoFllow</option>'; 

                    </select> 
                </td></tr>
            <tr><td><font color=red>* </font>Nội dung</td><td><textarea rows="5" cols="40" name="fulltext" id="soanthao"><?php
                        if (!empty($data)) {
                            echo $data->fulltext;
                        };
                        ?></textarea></td></tr>
            <tr><td style="text-align: center;" colspan="2"><input class="guidulieu" type="submit" value="Lưu"/></td></tr>
        </table>
    </div>
</form>
<script type="text/javascript">
    if (typeof CKEDITOR == 'undefined')
    {
        document.write("khong "
                );
    }
    else
    {
        var editor = CKEDITOR.replace('soanthao');
        CKFinder.setupCKEditor(editor, '<?php echo base_url(); ?>ckeditor/ckfinder/');
    }
</script>


<!--end sua bai viet-->